package com.roc.web.action.susMerinfo;

import java.util.ArrayList;
import java.util.List;

import com.roc.page.BaseSearchCondition;
import com.roc.page.WhereHQLFieldBean;
import com.roc.util.Constance;

public class SusMerinfoSearchCondition extends BaseSearchCondition{

	private String cardNo;
	private String businessLiscences;
	private String merinfo;
	private String areaCode;
	
	
	@Override
	protected List<WhereHQLFieldBean> getWhereHQLFieldBeanList() {
		// TODO Auto-generated method stub
		List<WhereHQLFieldBean> filedBeanList = new ArrayList<WhereHQLFieldBean>();
		
		if(Constance.isNotEmpty(cardNo)){ 
			filedBeanList.add(new WhereHQLFieldBean("s.cardNo", cardNo.trim(), "=", false));
		}
		if(Constance.isNotEmpty(businessLiscences)){ 
			filedBeanList.add(new WhereHQLFieldBean("s.businessLiscences", businessLiscences.trim(), "=", false));
		}
		if(Constance.isNotEmpty(merinfo)){ 
			filedBeanList.add(new WhereHQLFieldBean("s.merinfo", merinfo.trim(), "like",false,"ALL"));
		}
		if(Constance.isNotEmpty(areaCode)){ 
			filedBeanList.add(new WhereHQLFieldBean("s.areaCode", areaCode.trim(), "like",false,"ALL"));
		}
		
		return filedBeanList;
		
	}

	@Override
	protected String getRowCountHQL() {
		// TODO Auto-generated method stub
		return "select count(*) from susesMerinfo s where 1=1";
	}

	@Override
	protected String getSearchHQL() {
		// TODO Auto-generated method stub
		return "select s.cardNo,s.businessLiscences,s.merinfo,s.areaCode,s.business,s.col1 from susesMerinfo s where 1=1";
	}

	@Override
	protected String getOrderPartOfHQL() {
		// TODO Auto-generated method stub
		return null;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getBusinessLiscences() {
		return businessLiscences;
	}

	public void setBusinessLiscences(String businessLiscences) {
		this.businessLiscences = businessLiscences;
	}

	public String getMerinfo() {
		return merinfo;
	}

	public void setMerinfo(String merinfo) {
		this.merinfo = merinfo;
	}

	public String getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}

	
}
